﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using AteneoLibriBusinessLogic.Entities;

namespace AteneoLibri.Account
{
    public partial class Logout : System.Web.UI.Page
    {
        User user = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            user = Utility.HttpSessionManager.GetWebUser();
            Utility.HttpSessionManager.ClearWebUser(HttpContext.Current, user);
            Utility.HttpSessionManager.Clear();

            FormsAuthentication.SignOut();
            string url = System.Configuration.ConfigurationManager.AppSettings["webSiteURL"];
#if DEBUG
            url = "~/Default.aspx";
#endif
            Response.Redirect(url);

        }
    }
}